<%@page import="com.mongodb.DBObject"%>
<%@page import="com.mongodb.DBCursor"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ page import="com.jiangjun.fetch.mongo.MongoDBSupport"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>管理</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script>
	function remove(id) {
		alert(id);
		window.location.href = "removeRssAction?id=" + id;
	}
</script>

<style>
body {
	font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica,
		sans-serif;
	color: #4f6b72;
	background: #E6EAE9;
}

a {
	color: #c75f3e;
}

caption {
	padding: 0 0 5px 0;
	width: 700px;
	font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	text-align: right;
}

#mytable {
	width: 1200px;
	padding: 0;
	margin: 0;
}

th {
	font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	color: #4f6b72;
	border-right: 1px solid #C1DAD7;
	border-bottom: 1px solid #C1DAD7;
	border-top: 1px solid #C1DAD7;
	letter-spacing: 2px;
	text-transform: uppercase;
	text-align: left;
	padding: 6px 6px 6px 12px;
	background: #CAE8EA no-repeat;
}

th.nobg {
	border-top: 0;
	border-left: 0;
	border-right: 1px solid #C1DAD7;
	background: none;
}

td {
	border-right: 1px solid #C1DAD7;
	border-bottom: 1px solid #C1DAD7;
	background: #fff;
	font-size: 11px;
	padding: 6px 6px 6px 12px;
	color: #4f6b72;
}

td.alt {
	background: #F5FAFA;
	color: #797268;
}

th.spec {
	border-left: 1px solid #C1DAD7;
	border-top: 0;
	background: #fff no-repeat;
	font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}

th.specalt {
	border-left: 1px solid #C1DAD7;
	border-top: 0;
	background: #f5fafa no-repeat;
	font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	color: #797268;
}
</style>
</head>
<body>
	<div>
		<form action="addWeiboAction.do" method="post">
			<div>
				<span>name：</span> <input type="text" id="name" name="name" /> <br />
				<input type="submit" id="tijiao" name="tijiao" value="添加" />
			</div>
		</form>
	</div>
	<div>
		<table id="mytable">
			<tr>
				<th>序列号</th>
				<th>id</th>
				<th>名字</th>
				<th>是否删除</th>
				<th>操作</th>
			</tr>
			<%
				MongoDBSupport mongoDBSupport = MongoDBSupport.getInstance();
				DBCursor cursor = mongoDBSupport
						.queryCollection(MongoDBSupport._WEIBO);
				int count = 1;
				while (cursor.hasNext()) {
					DBObject obj = cursor.next();
			%>
			<tr>
				<td><%=count%></td>
				<td><%=obj.get("id").toString()%></td>
				<td><%=obj.get("name").toString()%></td>
				<%
					if ((obj.get("isEnable").toString()).equals("1")) {
				%>
				<td>否</td>
				<%
					} else if ((obj.get("isEnable").toString()).equals("0")) {
				%>
				<td>是</td>
				<%
					}
				%>
				<td>
					<a href="removeWeiboAction.do?id=<%=obj.get("id").toString() %>">【删除】</a>
					<a href="releaseWeiboAction.do?id=<%=obj.get("id").toString() %>">【恢复】</a>
				</td>
			</tr>
			<%
				count++;
				}
			%>
		</table>
	</div>
</body>
</html>
